import { defineStore } from 'pinia'

const useUserPinia = defineStore(
  'user',
  () => {
    const state = reactive({
      userId: '',
      token: '',
    })
    const action = {
      setToken: (token: string) => {
        state.token = token
      },
    }

    return { state, action }
  },
  {
    persist: true,
  }
)
export default useUserPinia
